package com.hxzy.shop.commodity.service;

import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


public interface DrugCarouselMapService {

    /**
     * 添加轮播图
     * @param drugCarouselMap 轮播图url
     * @param drugUId 商品id
     * @return 是否成功
     */
    @Transactional(rollbackFor = Exception.class)
    boolean addCarouselMap(@Param("drugCarouselMap") List<String> drugCarouselMap, @Param("drugUId") Long drugUId);

    /**
     * 获得轮播图
     * @param id 药品id
     * @return 对应的轮播图
     */
    Map<Integer, String> getCarouselMap(Long id);

    /**
     * 更新 轮播图
     * @param drugCarouselMap 轮播图
     * @param id 药品id
     * @return 是否成功
     */
    @Transactional(rollbackFor = Exception.class)
    boolean updateCarouselMap(List<String> drugCarouselMap, Long id);
}
